/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Util;

import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Lion
 */
public class MyTableModel extends AbstractTableModel{
    
     private String[] columnNames ;
    private Object[][] data ;
    public MyTableModel(String[] nombres, Object[][] data){
        this.columnNames= nombres;
        this.data=data;
    
    }

    @Override
    public int getRowCount() {
       // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\
        return data.length;
    }

    @Override
    public int getColumnCount() {
      //  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return this.columnNames.length;
    }

    @Override
    public Object getValueAt(int i, int i1) {
       // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
       if(i>=0 && i<getRowCount() && i1>=0 && i1<getColumnCount())
        return this.data[i][i1];
       else return null;
    }
    
}
